import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AdminModule } from './admin/admin.module';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { MYSQLCONFIG } from './config/db.config';
import { RoomModule } from './room/room.module';
import { UserModule } from './user/user.module';
import { DinnerModule } from './dinner/dinner.module';
import { OrderModule } from './order/order.module';
import { StartModule } from './start/start.module';
import { CommentModule } from './comment/comment.module';

@Module({
  imports: [
    ConfigModule.forRoot({ isGlobal: true }),
    TypeOrmModule.forRoot({
      ...MYSQLCONFIG,
    }),
    UserModule,
    AdminModule,
    RoomModule,
    DinnerModule,
    OrderModule,
    StartModule,
    CommentModule,
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
